<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    img {
      width: 350px;
      height: 500px;
    }
  </style>
</head>

<body>
  <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1278768677,437298174&fm=26&gp=0.jpg" alt="">
  <h3>苍老师，白天好</h3>
  <script>
    var img = document.querySelector('img')
    var h3 = document.querySelector('h3')

    var time = new Date()
    var seconds = time.getSeconds()
    if (seconds % 2 === 0) {
      img.src = 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1278768677,437298174&fm=26&gp=0.jpg'
      h3.innerText = '苍老师，白天好'
    } else {
      img.src = 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=148817165,2432516301&fm=26&gp=0.jpg'
      h3.innerText = '波老师，晚上好'
    }

    // setInterval(function () {
    //   var time = new Date()
    //   var seconds = time.getSeconds()
    //   if (seconds % 2 === 0) {
    //     img.src = 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1278768677,437298174&fm=26&gp=0.jpg'
    //   } else {
    //     img.src = 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=148817165,2432516301&fm=26&gp=0.jpg'
    //   }
    // }, 1000)

  </script>
</body>

</html>